//var tabulator = Cc["@dig.csail.mit.edu/tabulator;1"].getService().
//                wrappedJSObject;
var kb = tabulator.kb;
function handleInverseOfPred(PRED){
  return function(formula, subj, pred, obj){
    if (!formula.whether(obj, PRED, subj)){
        formula.add(obj, PRED, subj);
    }
  }
}
function handleInverseOf(formula, subj, pred, obj) {
  formula.newPropertyAction(subj, handleInverseOfPred(obj));
  //formula.newPropertyAction(obj, handleInverseOfPred(subj));
}

      
kb.newPropertyAction(tabulator.ns.owl('inverseOf'), handleInverseOf);
kb.add(tabulator.ns.sioc('container_of'),
       tabulator.ns.owl('inverseOf'),
       tabulator.ns.sioc('has_container'));


// { ?subj dc:title ?title .} => { ?subj dcterms:title ?title .}.
kb.newPropertyAction(tabulator.ns.dc('title'), function(f, s, p, o){
    f.add(s, tabulator.ns.dcterms('title'), o);
  });


 
